<template>
  <div class="flex flex-center space-x-14px">
    <el-tooltip effect="dark" content="经典" placement="top" :show-after="200">
      <div
        :class="[
          '_classic',
          'relative w-56px h-48px cursor-pointer bg-gray-300',
          {
            'is-acitve': layout === LayoutTypeEnum.CLASSIC
          }
        ]"
        @click="settingStore.setGlobalState('layout', LayoutTypeEnum.CLASSIC)"
      ></div>
    </el-tooltip>
    <el-tooltip effect="dark" content="混合" placement="top" :show-after="200">
      <div
        :class="[
          '_mix',
          'relative w-56px h-48px cursor-pointer bg-gray-300',
          {
            'is-acitve': layout === LayoutTypeEnum.MIX
          }
        ]"
        @click="settingStore.setGlobalState('layout', LayoutTypeEnum.MIX)"
      ></div>
    </el-tooltip>
    <el-tooltip effect="dark" content="横向" placement="top" :show-after="200">
      <div
        :class="[
          '_transverse',
          'relative w-56px h-48px cursor-pointer bg-gray-300',
          {
            'is-acitve': layout === LayoutTypeEnum.TRANSVERSE
          }
        ]"
        @click="settingStore.setGlobalState('layout', LayoutTypeEnum.TRANSVERSE)"
      ></div>
    </el-tooltip>
  </div>
</template>
<script setup lang="ts">
import { useSettingStore } from '@/stores'
import { LayoutTypeEnum } from '@/enums/LayoutTypeEnum'
const settingStore = useSettingStore()
const layout = computed(() => settingStore.layout)
</script>
<style lang="scss" scoped>
._classic {
  border: 2px solid #e5e7eb;
  border-radius: 4px;
  &::before {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 33%;
    height: 100%;
    content: '';
    background-color: #273352;
    border-radius: 4px 0 0 4px;
  }
  &::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 25%;
    content: '';
    background-color: #ffffff;
    border-radius: 4px 4px 0;
  }
}
._mix {
  border: 2px solid #e5e7eb;
  border-radius: 4px;
  &::before {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 33%;
    content: '';
    background-color: #273352;
    border-radius: 4px 4px 0 0;
  }
  &::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 33%;
    height: 100%;
    content: '';
    background-color: #273352;
    border-radius: 4px 0 0 4px;
  }
}
._transverse {
  border: 2px solid #e5e7eb;
  border-radius: 4px;
  &::before {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 33%;
    content: '';
    background-color: #273352;
    border-radius: 4px 4px 0 0;
  }
  &::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 33%;
    height: 100%;
    content: '';
    border-radius: 4px 0 0 4px;
  }
}
.is-acitve {
  border-color: var(--el-color-primary);
}
</style>
